package cn.kpt.biz.service.impl;

import cn.kpt.beans.vo.order.ItripOrderLinkUserVo;
import cn.kpt.biz.service.ItripOrderLinkUserService;
import cn.kpt.dao.itriporderlinkuser.ItripOrderLinkUserMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @version 1.0
 * @ClassName ItripOrderLinkUserServiceImpl
 * @Description TODO
 * @Author kangpengtao
 * @Date 2019/10/23 11:48
 */
@Service
public class ItripOrderLinkUserServiceImpl implements ItripOrderLinkUserService {
    @Resource
    private ItripOrderLinkUserMapper itripOrderLinkUserMapper;
    public List<ItripOrderLinkUserVo> getItripOrderLinkUserListByMap(Map<String,Object> param)throws Exception{
        ArrayList<ItripOrderLinkUserVo> result = new ArrayList<>();
        itripOrderLinkUserMapper.getItripOrderLinkUserListByMap(param).forEach(orderLinkUser->{
            ItripOrderLinkUserVo itripOrderLinkUserVo = new ItripOrderLinkUserVo();
            BeanUtils.copyProperties(orderLinkUser,itripOrderLinkUserVo);
            result.add(itripOrderLinkUserVo);
        });
        return result;
    }
}
